package com.eureka.cheng.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;

/**
 * @author 张在成
 * 安全认证配置类
 */
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

		@Override
		protected void configure(HttpSecurity http) throws Exception {
				//加这句是为了访问eureka控制台和/actuator时能做到安全监控
				super.configure(http);
				//忽略/eureka/**的所有请求
				http.csrf().ignoringAntMatchers("/eureka/**");
		}

}